package sg.edu.nus.iss.team8s.vmcs.Listener;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import sg.edu.nus.iss.team8s.vmcs.control.CoinReceiver;
import sg.edu.nus.iss.team8s.vmcs.control.TransactionController;
/**
 * 
 * @author Lu Zhi Xian
 *
 */
public class CoinInputListener implements ActionListener{

	private int weight;
	public CoinInputListener(int weight){
		this.weight = weight;
	}
	
	public void actionPerformed(ActionEvent arg0) {
		// TODO Auto-generated method stub
		CoinReceiver coinController = CoinReceiver.getInstance();
		coinController.setCoinWeight(weight);
		
		TransactionController tranController = TransactionController.getInstance();
		tranController.processState();
	}

}
